package com.aabte.lota.auth.common.util;

import com.aabte.lota.auth.auth.token.JWTTokenUtils;
import com.aabte.lota.auth.auth.token.payload.TokenPayloadDTO;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/4/1
 */
@Component
public class UserUtils {

  @Resource private JWTTokenUtils jwtTokenUtils;

  public TokenPayloadDTO getUser() {
    String token = ServletUtils.getJwtToken();
    return jwtTokenUtils.parseToken(token);
  }
}
